<?php

namespace App\Transformers;

use League\Fractal\TransformerAbstract;

class PeriodCoachTransformer extends TransformerAbstract
{

    public function transform($item)
    {
        return [
            "userid"=> $item->coach_id,
            "schoolid"=> $item->school_id,
            "nickname"=> $item->name,  //姓名
            "userphone"=> $item->mobile,  //电话
            "username"=>"", //用户名
            "about"=>"", //个人简介
            "sex"=> $item->sex, //性别
            "avatar"=> $item->photo, //头像
            "distance"=>0,//距离
            "school"=>"",  //所属驾校
            "only"=>0, //剩余可预约学时
            "num_comment"=> $item->evaluation, //评论总数
            "positive_ratio"=> $item->evaluationrate, //好评率
            "num_student"=> 0 //所属学员
        ];

    }


}
